package PTA.javaA;
import java.util.Scanner;
import java.util.Arrays;
import java.util.Scanner;

public class ex05 {
    static int nums[];
    public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNextLine()){
    String choice = sc.nextLine();
    switch (choice){
        case "fib":
            fib();
            break;
        case "sort":
            sort();
            break;
        case "search":
           // search();
            break;
        case "getBirthDate":
            getBirthDate();
            break;
        default:
            System.out.println("exit");
            System.exit(0);
    }

}

    }
    public static void fib(){
        Scanner sc = new Scanner(System.in);
    String str = sc.nextLine();
    int n=Integer.parseInt(str);
        int a=1;
        int b=1;
        for(int i=1;i<=n;i++){
            if(i==1){
                System.out.print(a);
            }else if(i==2){
                System.out.print(" "+b);
            }else if(i>=3){
int temp = a+b;
a=b;
b=temp;
                System.out.print(" "+temp);
            }
        }
    }
public static int[] sort(){
        Scanner sc=  new Scanner(System.in);
        String line = sc.nextLine();
        String numb[]=line.split("\\s+");
    int nums[] = new int[numb.length];
for(int i=0;i<numb.length;i++){
    nums[i]=Integer.parseInt(numb[i]);
}
Arrays.sort(nums);
    System.out.println(Arrays.toString(nums));
    return nums;
}
public static void search(int []nums){
    Scanner sc = new Scanner(System.in);
    String str = sc.nextLine();
    int a= Integer.parseInt(str);
    int index = Arrays.binarySearch(nums,a);
if(index>=0){
    System.out.println(index);
}else{
    System.out.println("-1");
}
}
public static void getBirthDate() {
    Scanner sc = new Scanner(System.in);
    String nstr = sc.nextLine();
    int n = Integer.parseInt(nstr);
    for (int i = 0; i < n; i++) {
        String id = sc.nextLine();
        System.out.println(id.substring(6, 10)+"-"+id.substring(10, 12)+"-"+id.substring(12, 14));
    }
}

}



